crypto = require "crypto"
db     = require "db"
_      = require "./lib/underscore.js"

class Project
  constructor: (title) ->
    @title = title

  fields:
    'title': (x) ->
      x.length >= 2 && x.match(/kake/)

    'phase': (x) ->
      _.include ['idea', 'task', 'proposal'], x

  validate: ->
  required_fields:
    idea: ['title','description']
    proposal: ['']

      validate_fields(['title', 'phase'])
    _.all(fields[field](this[field]) for field of fields)

authenticate = (username,password_cleartext) ->
    password_md5_ed = crypto.md5(password_cleartext)